<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('nav_path'))
{
	
	function nav_path($segments){
		include(APPPATH.'config/dns_titles.php');
		$separator = ' > ';
		$_titles = $dns_titles[$segments[1]];
		$path = '当前位置：';
		if($_titles['nav'][$segments[2]] == '首页'){
			$path .='<a href='.site_url($segments[1]).'/'.$segments[2].'>'.$_titles['nav'][$segments[2]].'</a>';
		}else{
			$path .='<a href="http://www.52dns.com">首页</a>'.$separator.'<a href='.site_url($segments[1]).'/'.$segments[2].'>'.$_titles['nav'][$segments[2]].'</a>';
			if(!isset($segments[3])){
				$path .= $separator.'<span>'.$_titles[$segments[2]]['index'].'</span>';
			}else if($segments[3] != 'index'){
				if(isset($_titles[$segments[2]][$segments[3]]))
					$path .= $separator.'<span>'.$_titles[$segments[2]][$segments[3]].'</span>';
			}else{
				if(isset($segments[4])){
					if(isset($_titles[$segments[2]][$segments[4]]))
						$path .= $separator.'<span>'.$_titles[$segments[2]][$segments[4]].'</span>';
				}else{
					$path .= $separator.'<span>'.$_titles[$segments[2]]['index'].'</span>';
				}
			}
		}
		return $path;
	}
}

if ( ! function_exists('cur_nav'))
{
	function cur_nav($segments){
		include_once(APPPATH.'config/dns_titles.php');
		return $dns_titles[$segments[1]]['nav'][$segments[2]];
	}
}
?>